home *** CD-ROM | disk | FTP | other *** search
/ Mac100% 1998 November / MAC100-1998-11.ISO.7z / MAC100-1998-11.ISO / オンラインソフト定点観測 / ユーティリティ / Mops 3.2.sea / Mops 3.2 / Mops source / PPC source / test1 < prev    next >
Text File  |  1998-06-08  |  1KB  |  80 lines

  1. :class    DIC-MARK    super{ object }
  2.  
  3. #threads    array    LINKS
  4. record {    int        CURRENT    }
  5.  
  6. private
  7.  
  8. :m  SETC:  { ¥ addr index -- index }
  9.     0 -> addr  0 -> index
  10.     #threads FOR
  11.         i at: links  dup addr u>
  12.         IF  -> addr  i -> index  ELSE  drop  THEN
  13.     NEXT
  14.     index  put: current  ;m
  15. public
  16.  
  17. :m CURRENT:
  18.     get: current  at: links  ;m
  19.  
  20.  
  21. :m SET:  { targ_addr ¥ addr in_cg? -- }
  22.     targ_addr nuc_code_start u<  -> in_cg?    ¥ if targ_addr is in the code generator
  23.     #threads FOR
  24.         context  i  2 <<  +  displace  -> addr
  25.         BEGIN
  26.             addr nuc_code_start u<  in_cg?  xor
  27.             addr targ_addr u>  or
  28.         WHILE            ¥ targ_addr not reached yet
  29.             addr displace  -> addr
  30.         REPEAT
  31.         addr  i to: links
  32.     NEXT
  33.     setc: self  ;m
  34.  
  35. (*
  36. :m SET:  { addr -- }
  37.     #threads FOR
  38.         context  i  2 <<  +  displace
  39.         BEGIN    dup addr u>            ¥ We're 32-bit clean around here!
  40.         WHILE    displace
  41.         REPEAT
  42.         i to: links
  43.     NEXT
  44.     setc: self  ;m
  45. *)
  46.  
  47. :m SETTOTOP:
  48.     big#  set: self  ;m
  49.  
  50. :m NEXT:  { ¥ lfa -- lfa }
  51.     get: current  at: links
  52.     dup -> lfa  dup  0EXIT
  53.     displace  get: current  to: links
  54.     setc: self  lfa
  55. ;m
  56.  
  57. ;class
  58.  
  59. dic-mark    TheMARK
  60. 0    value    words_limit
  61.  
  62.  
  63. : xxxx  { ¥ svbase svcurs n -- }
  64.     setToTop: theMark  0 -> out  0 -> n
  65.     cr
  66.     BEGIN
  67.         next: theMark  dup  0<>
  68. ¥        n words_limit <  and
  69.     WHILE
  70.         1 ++> n
  71.         out 60 >
  72.         IF  cr  0 -> out  ?pause  THEN
  73.         link> dup  6 .r  2 spaces  .id  space
  74.         20  out 20 mod -  spaces
  75.     REPEAT
  76.     drop
  77.     cr ." No of words: "  n .  cr
  78. ;
  79.  
  80.